#include "TimedAction.h"

/*
|| <<constructor>>
 */
TimedAction::TimedAction(unsigned long intervl,void (*function)()){
  previous = 0;
  interval = intervl;
  execute = function;
}

/*
|| <<constructor>>
 */

bool  TimedAction::check(unsigned long est_sec){
  if (  (est_sec-previous >= interval) ) {
    previous = (unsigned long) est_sec/interval*interval ;
    execute();
    return(TRUE);
  }
  return(FALSE);
}


